import { TApproveRecords } from '@/plugins/approve'

// 获取是否最后一个审批人
export function isLastApprovePerson(approveRecords: TApproveRecords) {
  const lens = approveRecords?.length
  if (!lens) return false
  const lastRecord = approveRecords?.[lens - 1]
  return Boolean(lastRecord?.isLastNode)
}

// 获取最后一个审批的节点
export function getLastApproveItem(approveRecords: TApproveRecords) {
  const lens = approveRecords?.length
  if (!lens) return null
  const lastRecord = approveRecords?.[lens - 1]
  return lastRecord
}
